<?php $_order = $this->getOrder() ?>

<div class="col3-set order-info-box">
    <div class="col-1" style="width: 28%">
        <div class="box">
            <div class="box-title">
                <h2><?php echo $this->__('Shipping Address') ?></h2>
            </div>
            <div class="box-content">
                <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
            </div>
             <div class="box-title">
                <h2><?php echo $this->__('Shipping Method') ?></h2>
            </div>
            <div class="box-content">
                <?php if ($_order->getShippingDescription()): ?>
                    <?php echo $this->escapeHtml($_order->getShippingDescription()) ?>
                <?php else: ?>
                    <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
                <?php endif; ?>
                <div class="box-sub-order">
                <?php
                    //显示子订单号，用到查询路由信息
                    $increment_id = $_order->getRealOrderId();
                    if($increment_id)
                    {
                        $subOrder = Mage::getModel('saleorderservice/order')->getCollection();
                        $subOrder->getSelect()->where("increment_id like '%{$increment_id}%'");
                        if(!empty($subOrder->getData()))
                        {
                            foreach ($subOrder->getData() as $key => $value)
                            {
                                echo '<a href="'. Mage::getUrl() .'ordertrackinginfo/index/orderid/'. $value['increment_id'] .'" target="_blank">';
                                echo $value['increment_id'];
                                echo '</a><br/>';
                            } 
                        }
                    }
                    
                ?>
                </div>
            </div>
        </div>
    </div>
    <div class="col-2" style="width: 69%;float:right">
    <table class="data-table" id="my-orders-table" summary="<?php echo Mage::helper('core')->quoteEscape($this->__('Items Ordered')) ?>">
    <col />
    <col width="1" />
    <col width="1" />
    <col width="1" />
    <col width="1" />
    <thead>
        <tr>
            <th><?php echo $this->__('Product Name') ?></th>
            <th><?php echo $this->__('SKU') ?></th>
            <th class="a-right"><?php echo $this->__('Price') ?></th>
            <th class="a-center"><?php echo $this->__('Qty') ?></th>
            <th class="a-right"><?php echo $this->__('Subtotal') ?></th>
        </tr>
    </thead>
    <tfoot>
        <?php echo $this->getChildHtml('order_totals') ?>
    </tfoot>
        <?php $_items = $_order->getItemsCollection(); ?>
        <?php $_index = 0; ?>
            <?php $_count = $_items->count(); ?>
        <?php foreach ($_items as $_item): ?>
        <?php if ($_item->getParentItem()) continue; ?>
        <tbody>
            <?php echo $this->getItemHtml($_item) ?>
            <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
            <tr class="border<?php echo ($_index++ > $_count ?' last':'') ?>" id="order-item-gift-message-<?php echo $_item->getId() ?>" style="display:none;">
                <?php $_giftMessage=$this->helper('giftmessage/message')->getGiftMessageForEntity($_item); ?>
                <td class="gift-message-row" colspan="7">
                    <a href="#" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Close')) ?>" onclick="return giftMessageToogle('<?php echo $_item->getId() ?>');" class="btn-close"><?php echo $this->__('Close') ?></a>
                    <dl class="gift-message">
                        <dt><strong><?php echo $this->__('From:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?></dt>
                        <dt><strong><?php echo $this->__('To:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?></dt>
                        <dd><?php echo $this->helper('giftmessage/message')->getEscapedGiftMessage($_item) ?></dd>
                    </dl>
                </td>
            </tr>
            <?php endif ?>
        </tbody>
        <?php endforeach; ?>
</table>
    </div>
</div>

<!-- <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>-->

<script type="text/javascript">decorateTable('my-orders-table', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>